<template>
	<view class="a">
		<uni-nav-bar @clickLeft="back" left-text="返回" title="缴费记录" />
		<view class="top">
			<text>全部</text>
			<view class="type">
				<select name="" id="" style="margin-top: 30rpx;border: 0rpx;">
					<option value="">缴费类型</option>
					<option value="" v-for="(item,index) in feetypelist2" :key="index">{{item.name}}</option>
				</select>
			</view>
		</view>
		<view class="navigation">
			<view style="display: flex;">
				<select style="border: 0rpx; background-color: #d8d7d7;" name="" id="">
					<option value="" v-for='(item,index) in list ' :key='index'>{{item.building+item.houseno}}</option>
				</select>
			</view>

			<view>
				<select name="" id="" style="border: 0rpx;background-color: #d8d7d7; margin-top: 10rpx;">
					<option value="">{{time}}</option>
				</select>
			</view>
		</view>
		<view class="body" v-for="(item,index) in feelist2">
			<view class="content">
				<view class="dan">
					<text>物业费账单</text>
				</view>
				<view class="qita">
					<text>房号</text>
					<text>{{item.id}}</text>
				</view>
				<view class="qita">
					<text>账单</text>
					<text>{{item.enddate}}至{{item.begindate}}</text>
				</view>
				<view class="qita">
					<text>账单金额</text>
					<text>￥{{item.price}}元</text>
				</view>
				<view class="qita">
					<text>缴费时间</text>
					<text>{{item.addtime}}</text>
				</view>
				<view class="qita">
					<text>付款方式</text>
					<text>{{item.state===1 ?'微信支付' :'支付宝支付'}}</text>
				</view>
			</view>
		</view>

	</view>
</template>


<script>
	import request from '../../utils/request.js'
	import {
		feelist,
		feetypelist
	} from '../../api/fee.js'


	export default {
		data() {
			return {
				feelist2: [],
				feetypelist2:[],
				list:[],
				time:[]
			}
		},
		onLoad() {
			this.getfeelist();
			this.getfeetypelist();
			this.list = uni.getStorageSync('buildings')
			this.time = uni.getStorageSync('userinfo').addtime.slice(0,7)
		},
		methods: {
			// record(){
			// 	uni.navigateTo({
			// 		url:'../fee/index'
			// 	})
			// },
			back(){
				uni.navigateBack({
					delta:1
				})
			},
			async getfeelist() {
				let data = await feelist();
				this.feelist2 = data.data.list
				console.log(data)
			},
			async getfeetypelist() {
				let data = await feetypelist();
				this.feetypelist2 = data.data.list
				console.log(data)
			},
		},
	}
</script>

<style>
	@import '../../static/style/fee.less';
</style>
